<?php

use yii\db\Migration;

/**
 * Handles the creation of table `project_like`.
 */
class m171101_031104_create_project_like_table extends Migration
{
    /**
     * @inheritdoc
     * 项目标记记录（关注、标亮点）
     */
    public function up()
    {
        $this->createTable('project_like', [
            'id' => $this->bigPrimaryKey(),
            'type' => $this->smallInteger()->defaultValue(1)->notNull()->comment('类型'),//1关注2标为亮点
            'project_id' => $this->bigInteger()->notNull(),
            'user_id' => $this->integer()->notNull(),
            'created_at' => $this->timestamp(),
        ]);
    }

    /**
     * @inheritdoc
     */
    public function down()
    {
        $this->dropTable('project_like');
    }
}
